<?php
$params = require(__DIR__ . '/../web/config/params.php'); 
if (YII_ENV == 'dev') {
    //$params['wap_url'] = 'http://localhost/WWW/pro_liecb/basic/wap';
    //$params['web_url'] = 'http://localhost/WWW/pro_liecb/basic/web';
    //$params['api_url'] = 'http://localhost/WWW/pro_liecb/basic/api';
    //$params['theme_url'] = 'http://localhost/WWW/pro_liecb/basic/web//themes/v1.0';

    $params['wap_url'] = 'http://localhost/chindor_kpi/basic/wap';
    $params['web_url'] = 'http://localhost/chindor_kpi/basic/web';
    $params['api_url'] = 'http://localhost/chindor_kpi/basic/api';
    $params['theme_url'] = 'http://localhost/chindor_kpi/basic/web/themes/v1.0';

} else {
    $params['wap_url'] = 'http://kpi.chindor.com/wap';
    $params['web_url'] = 'http://kpi.chindor.com/web';
    $params['api_url'] = 'http://kpi.chindor.com/api';
    $params['theme_url'] = 'http://kpi.chindor.com/web/themes/v1.0';
}

$params['img_host'] = 'http://localhost/chindor_kpi/basic';
// $params['img_host'] = 'http://lcb.chindor.com';
// $params['img_url'] = 'http://lcb.chindor.com';
$config = [
    'id' => 'basic',
    'timeZone' => 'Asia/Shanghai',
    'language'=>'zh-CN',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'defaultRoute' => 'user/default/index',
    'components' => [
        'request' => [
            'cookieValidationKey' => '9oVZ7xEIgyyBlpE5_Fp0WxDTCjahLrP1',
            'enableCsrfValidation' => false,
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'suffix' => '.html',//后缀
            'enableStrictParsing'=>false,//不要求网址严格匹配，则不需要输入rules
            'rules' => require(__DIR__ . '/../web/config/rule.php'),
        ],
        'errorHandler' => [
            'errorAction' => 'home/error/index',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'db' => require(__DIR__ . '/db.php'),
    ],

    'params' => $params,
    'modules' => [
        // 'home' => [
        //     'class' => 'app\web\modules\home\Module',
        // ],
        // 'cmp' => [
        //     'class' => 'app\web\modules\cmp\Module',
        // ],
        // 'head' => [
        //     'class' => 'app\web\modules\head\Module',
        // ],
        // 'owner' => [
        //     'class' => 'app\web\modules\owner\Module',
        // ],
        'user' => [
            'class' => 'app\web\modules\user\Module',
        ],
    ],
];

return $config;
